from django.db import models
from intr.models.models import Society
from django.contrib.auth.models import User

class BlogPost(models.Model):
	title = models.CharField(max_length=200)
	slug = models.SlugField(max_length=200, blank=False)
	added = models.DateField(auto_now_add=True)
	updated = models.DateField(auto_now=True)
	public = models.BooleanField(default=True)
	content = models.TextField()
	society = models.ForeignKey(Society)
	author = models.ForeignKey(User)

	def __unicode__(self):
		return self.title

	class Meta:
		permissions = (
			("create_post", "Can create a new blog post"),
			("edit_post", "Can edit a blog post"),
			("delete_post", "Can delete a blog post")
		)
			
